from selenium.webdriver.support.ui import WebDriverWait
class Base():
    def __init__(self,dr):
        self.dr=dr
    def get_url(self,url):
        self.dr.get(url)
    def find_element(self,loc):
        # try:
        #     WebDriverWait(self.dr,20,0.5).until(lambda dr:self.find_element(*loc))
        return self.dr.find_element(*loc)
        # except Exception as e:
        #     print(e)
    def send_keys(self,loc,login):
        self.find_element(loc).send_keys(login)
    def click(self,loc):
        self.find_element(loc).click()
    def yem(self):
        self.dr.switch_to.window(self.dr.window_handles[-1])
    def demd(self,loc):
        self.dr.implicitly_wait(loc)
    def jr(self,loc):
        self.dr.switch_to.frame(loc)